package com.design.patterns.list.flyweight;

/**
 * 客户端
 * @author Wangzhiwen
 */
public class FlyweightClient {

    public static void main(String[] args) {

        Flyweight one = FlyweightFactory.getFlyweight("one");
        one.operation("One Extrinsic State");
        Flyweight two = FlyweightFactory.getFlyweight("two");
        two.operation("Two Extrinsic State");
        Flyweight flyweight = FlyweightFactory.getFlyweight("one");
        flyweight.operation("Three Extrinsic State");
        int flyweightCount = FlyweightFactory.flyweightCount();
        System.out.println("享元对象总数：" + flyweightCount);
    }

}
